


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 将data中的数据的key按照改为指定的英文 
        // 思考如何将data中数据转化为最终输出的结果
       function dataFormate(data){
               const mapInfo = {
                   '入职日期': 'timeOfEntry',
                   '手机号': 'mobile',
                   '姓名': 'username',
                   '转正日期': 'correctionTime',
                   '工号': 'workNumber',
                   '部门': 'departmentName',
                   '聘用形式': 'formOfEmployment'
               }
   
               // 1.1  遍历数组
              const result =    data.map(zhItem=> {
               const enObj ={}
               const zhkeys = Object.keys(mapInfo)
               zhkeys.forEach(element => {
                   enObj[mapInfo[element]] = zhItem[element]
               });
              return enObj
               })
               return result  
        }
   
   
       
    </script>
</head>

<body>

</body>

</html>